/**
 * Copyright (c) 2009 blurredVision
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 * associated documentation files (the "Software"), to deal in the Software without restriction, 
 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 
 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or 
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 
 * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 
 * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#if defined(DEBUG) | defined(_DEBUG)
	#define _CRTDBG_MAP_ALLOC
	#include <stdlib.h>
	#include <crtdbg.h>
	#define D3D_DEBUG_INFO 1
#endif

// If app hasn't choosen, set to work with Windows 98, Windows Me, Windows 2000, Windows XP and beyond
#ifndef WINVER
#define WINVER         0x0410
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0410 
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT   0x0500 
#endif

//#pragma once
 #pragma warning(disable:4995 4996 4005)

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
#include <mmsystem.h>


// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>

// TODO: reference additional headers your program requires here

#define DIRECTINPUT_VERSION 0x0800

#define DELETE_ARRAY(p)	  { if(p) { delete[] p; p = NULL; } }
#define DELETE_POINTER(p) { if(p) { delete p; p = NULL; } }

#define RELEASE(p) { if (p) { int newRefcount = p->Release(); if (newRefcount == 0) p = NULL; } }

// Define import and export of dll functions. In Linux, no special export is necessary
#ifdef _WIN32
	#define DLL_EXPORT __declspec(dllexport)
	#define DLL_IMPORT __declspec(dllimport)
#else
	#define DLL_EXPORT 
	#define DLL_IMPORT 
#endif

// Disable the warning for dll export of STL parts
#pragma warning( disable: 4251 )

#include "./LogFile.h"

#define PI 3.141592654f
#define HALFPI (PI/2.0f)

#include <iostream>
#define STDCOUT(x) std::cout << #x << ": "<< x << std::endl;
#define STRINGCOUT(x) std::cout << x << std::endl;

#include <functional>
#ifndef __LESSBYPOINTERTOVALUE
#define __LESSBYPOINTERTOVALUE
template <typename T>
struct LessByPointedToValue
  : std::binary_function<T const *, T const *, bool>
{
  bool operator()(T const * x, T const * y) const
     { return std::less<T>()(*x, *y); }
};
#endif

#ifndef __GREATERBYPOINTERTOVALUE
#define __GREATERBYPOINTERTOVALUE
template <typename T>
struct GreaterByPointedToValue
  : std::binary_function<T const *, T const *, bool>
{
  bool operator()(T const * x, T const * y) const
  { return std::greater<T>()(*x, *y); }
};
#endif

//#define CORE_UNDEFINED	0
#define CORE_DIRECTX	1
//#define CORE_OPENGL		2

